﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace BanXeTang
{
    public class VatPham
    {
        private MySprite spriteVatPham;
        private int iDVatPham;
        private int nTexture;
        private double thoiGian;      
        private double maxThoiGian;

        public double ThoiGian
        {
            get { return thoiGian; }
            set { thoiGian = value; }
        }
        public double MaxThoiGian
        {
            get { return maxThoiGian; }
            set { maxThoiGian = value; }
        }
        public int NTexture
        {
            get { return nTexture; }
            set { nTexture = value; }
        }

        public MySprite SpriteVatPham
        {
            get { return spriteVatPham; }
            set { spriteVatPham = value; }
        }
       
        public int IDVatPham
        {
            get { return iDVatPham; }
            set { iDVatPham = value; }
        }

        public VatPham(ContentManager Content, int _nTexture, float x, float y, int ID)
        {
            NTexture = _nTexture;
            SpriteVatPham = new MySprite(GlobalSettings.vatPham, x, y);
            SpriteVatPham._itexture2d = ID;
            IDVatPham = ID;
            thoiGian = 0;
            maxThoiGian = 1000;
        }

        public void Update(GameTime gameTime)
        {
            //spriteVatPham.Update(gameTime);
            thoiGian++;
        }
        public bool CheckThoiGianHopLe()
        {
            if (thoiGian < maxThoiGian)
            {
                return true;
            }
            return false;
        }
        public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            spriteVatPham.Draw(gameTime, spriteBatch, Color.White);
        }
    }
}
